package com.nuoniu.sibanyun.entity.finance;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.nuoniu.sibanyun.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;

/**
 * <p>
 * 科目总账
 * </p>
 *
 * @author 小啊刚
 * @since 2021-04-25
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("fag_acc_ledger")
@ApiModel(value="VAccountingLedger对象", description="科目总账")
public class VAccountingLedger extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "租户id")
    @TableField("company_id")
    private Integer companyId;

    @ApiModelProperty(value = "账套id")
    @TableField("account_id")
    private Integer accountId;

    @ApiModelProperty(value = "账套年份")
    @TableField("account_year")
    private Integer accountYear;

    @ApiModelProperty(value = "账套期间")
    @TableField("account_period")
    private Integer accountPeriod;

    @ApiModelProperty(value = "科目id")
    @TableField("accounting_id")
    private Integer accountingId;

    @ApiModelProperty(value = "科目上级id")
    @TableField("accounting_parent_id")
    private Integer accountingParentId;

    @ApiModelProperty(value = "科目级次")
    @TableField("accounting_depth")
    private Integer accountingDepth;

    @ApiModelProperty(value = "科目名称")
    @TableField("accounting_name")
    private String accountingName;

    @ApiModelProperty(value = "科目编码")
    @TableField("accounting_code")
    private String accountingCode;

    @ApiModelProperty(value = "是否末级")
    @TableField("is_end_node")
    private Integer isEndNode;

    @ApiModelProperty(value = "币种名称")
    @TableField("currency_name")
    private String currencyName;

    @ApiModelProperty(value = "期初金额方向1:借2:贷")
    @TableField("begin_amount_direction")
    private Integer beginAmountDirection;


    @ApiModelProperty(value = "期末金额方向1:借2:贷3:平")
    @TableField("end_amount_direction")
    private Integer endAmountDirection;
    @ApiModelProperty(value = "期初金额")
    @TableField("begin_amount")
    private BigDecimal beginAmount = new BigDecimal(0.0);

    @ApiModelProperty(value = "期末金额")
    @TableField("end_amount")
    private BigDecimal endAmount = new BigDecimal(0.0);

    @ApiModelProperty(value = "借方金额")
    @TableField("debit_amount")
    private BigDecimal debitAmount = new BigDecimal(0.0);

    @ApiModelProperty(value = "贷方金额")
    @TableField("credit_amount")
    private BigDecimal creditAmount = new BigDecimal(0.0);

    @ApiModelProperty(value = "外币期初金额")
    @TableField("currency_begin_amount")
    private BigDecimal currencyBeginAmount;

    @ApiModelProperty(value = "外币期末金额")
    @TableField("currency_end_amount")
    private BigDecimal currencyEndAmount;

    @ApiModelProperty(value = "外币借方金额")
    @TableField("currency_debit_amount")
    private BigDecimal currencyDebitAmount;

    @ApiModelProperty(value = "外币贷方金额")
    @TableField("currency_credit_amount")
    private BigDecimal currencyCreditAmount;

    @ApiModelProperty(value = "数量期初")
    @TableField("quantity_begin")
    private BigDecimal quantityBegin;

    @ApiModelProperty(value = "数量期末")
    @TableField("quantity_end")
    private BigDecimal quantityEnd;

    @ApiModelProperty(value = "数量借方")
    @TableField("quantity_debit")
    private BigDecimal quantityDebit;

    @ApiModelProperty(value = "数量贷方")
    @TableField("quantity_credit")
    private BigDecimal quantityCredit;

    @TableField(exist = false)
    private String periodDate;

    @TableField(exist = false)
    private BigDecimal noCreditAmount;

    @TableField(exist = false)
    private BigDecimal noDebitAmount;
}
